<template>
<view class="container">
    <view class="orderTop bw">
        <text>{{order_detail.now_group.merchant_name}}</text>
    </view>
    <view class="productBox bw cf">
        <view class="dealcard cf">
            <view class="dealcard-img">
                <image :src="order_detail.now_group.pic"></image>
            </view>
            <view class="dealcard-block-right">
                <view class="dealcard-brand">{{order_detail.now_group.s_name}}</view>
                <view class="price">￥{{order_detail.now_order.price}} x {{order_detail.now_order.num}}</view>
            </view>
        </view>
        <view class="dealcard-footer">实付款：￥{{order_detail.now_order.total_money}}</view>
    </view>
    <view class="merchant_info cf bw">适用店铺<view class="fr">查看</view></view>
</view>
</template>

"<script>
import common from '../../utils/common.js'

export default {
  data() {
    return {
      order_id: 0,
      order_detail: {}
    };
  },

  onUnload: function () {},
  onHide: function () {},
  onShow: function () {
	  // #ifdef H5
	  common.hideWxShare()
	  // #endif
  },
  onReady: function () {},
  onLoad: function (options) {
    this.setData({
      order_id: options.order_id
    });
    common.post('My&a=group_order_detail', {
      order_id: options.order_id
    }, "setOneContent", this);
  },
  components: {},
  props: {},
  methods: {
    setOneContent: function (res) {
      this.setData({
        order_detail: res
      });
      wx.hideToast();
    },
    setData: function (obj) {
      let that = this;
      let keys = [];
      let val, data;
      Object.keys(obj).forEach(function (key) {
        keys = key.split('.');
        val = obj[key];
        data = that.$data;
        keys.forEach(function (key2, index) {
          if (index + 1 == keys.length) {
            that.$set(data, key2, val);
          } else {
            if (!data[key2]) {
              that.$set(data, key2, {});
            }
          }

          data = data[key2];
        });
      });
    }
  }
};
</script>
<style>
.orderTop{
    height:100rpx;
    line-height:100rpx;
    padding-left:20rpx;
    position:relative;
    border-bottom: 2rpx solid #f1f1f1;
}
.orderTop:after {
    position: absolute;
    right: 20rpx;
    top: 50%;
    display: block;
    content: '';
    width: 12rpx;
    height: 12rpx;
    border-left: 2rpx solid #999;
    border-bottom: 2rpx solid #999;
    -webkit-transform: rotate(-135deg);
    margin-top:-6rpx;
}

.productBox{
    padding:30rpx 20rpx;
}
.dealcard{
    background:#f4f4f4;
    padding:16rpx;
}
.dealcard-brand{
    margin-top:12rpx;
    margin-bottom:20rpx;
}
.dealcard-footer{
    margin-top:30rpx;
}
.merchant_info{
    margin:20rpx 0;
    padding:0rpx 20rpx;
    height:80rpx;
    line-height:80rpx;
}
.merchant_info .fr{
    color:#999;
    font-size:24rpx;
}
</style>